package vipcard.meichehui.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import vipcard.meichehui.domain.Vip;
//用户验证
@Mapper

@Component
public interface VipMapper extends BaseMapper<Vip> {
    @Select("select nickname from sys_vip where id=#{id}")
    String findvip(@Param("id") String id);

    //查询用户是否被绑定
    @Select("select * from sys_wg where carnumber=#{carnumber}")
    String findvipbiand(@Param("carnumber") String carnumber);

    @Select("select * from sys_vip where nickname=#{nickname} ")
    String findsysvip(@Param("nickname") String nickname);

    @Update("UPDATE sys_vip SET nickname = #{nickname} WHERE sys_vip.id=#{id};")
    Integer updata(@Param("id") String id,@Param("nickname") String nickname);
}
